﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.interfaces;
using System.Web.UI;

namespace Module.MultiSiteFields.Controls.NodeBrowser
{
    public class PropertyDataEditor : System.Web.UI.WebControls.WebControl, IDataEditor
    {
        #region registration
        private IDataType DataType;

        public PropertyDataEditor(IDataType dataType)
        {
            DataType = dataType;
        }

        public System.Web.UI.Control Editor
        {
            get { return this; }
        }

        public void Save()
        {
            ///it's just browser, nothing need to be save
        }

        public bool ShowLabel
        {
            get { return true; }
        }

        public bool TreatAsRichTextEditor
        {
            get { return false; }
        }

        #endregion
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            Control c = Page.LoadControl("~/umbraco/ism/fields/nodebrowser/editor.ascx");
            
            this.Controls.Add(c);
        }
    }
}
